home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Information / WebSites / Wirenet / files / Dashboard2.lha / Dashboard2 / UpdateWirenet < prev    next >
Text File  |  1998-04-23  |  11KB  |  351 lines

  1. ; $VER: UpdateWirenet 2.0 (23.3.98)
  2. ;
  3. ; This installer and the accompanying scripts are
  4. ; (c) Neil Bothwick, Wirenet Amiga Internet and may
  5. ; not be used in any other package without permission
  6.  
  7. ; This updates a Wirenet 1.5/1.51 installation to the new Dashboard2 setup
  8. ; If you do not already have Wirenet 1.5 installed you should download and
  9. ; install this first.
  10. ; It is available from http://www.wirenet.u-net.com/updates.html
  11.  
  12. ;========================== Define Procedures ==========================
  13. (set ArcName 'Dashboard2.lha')
  14. ;;; Abort with message
  15. (procedure GetOut GetOutMsg
  16.         (message GetOutMsg)
  17.         (exit (quiet))
  18. )
  19. ;;;
  20. ;;; Setup message strings
  21. (set
  22.     NoArexxMsg
  23.         (cat
  24.             '\nThe update cannot proceed without Rexxmast running.\n\n'
  25.             'You should have Arexx active on your system at all times, please drag '
  26.             'the rexxmast icon from your System drawer to WBStartup and reboot'
  27.         )
  28.     BadArrexMsg
  29.         (cat
  30.             '\nThe execution of an Arexx script failed\n'
  31.             NoArexxMsg
  32.         )
  33.     IntroMsg
  34.         (cat
  35.             '\nHello ' (getenv 'REALNAME') '\n\n'
  36.             'This will update your Wirenet software to the latest current setup. '
  37.             'This uses a new GUI with a preferences editor for altering most settings\n\n'
  38.             'It also has several other new features, read the documentation for more information.\n\n'
  39.             'The installer will copy your previous files to a directory called Old, '
  40.             'in case you should need to revert to them for any reason.'
  41.         )
  42.     Already2Msg
  43.         (cat
  44.             '\nYou appear to have a version of Dashboard 2 installed already.\n\n'
  45.             'Do you want to update it or uninstall it?'
  46.         )
  47.     Already2Help
  48.         (cat
  49.             '\n"Update" will update your Dashboard 2 installation to the latest versions.'
  50.             '\n\n"Uninstall" will restore the Dashboard 1.5 files that were backed up '
  51.             'when you updated to Dashboard 2'
  52.         )
  53.     OldDBMsg
  54.         (cat
  55.             '\nThis installer will only update from Dashboard 1.5 or 1.51\n\n'
  56.             'If you do not already have Wirenet 1.5 installed you should '
  57.             'download and install 1.51 first.\n\n'
  58.             'It is available from http://www.wirenet.u-net.com/updates.html'
  59.         )
  60.  
  61.     ConvertConfigMsg
  62.         (cat
  63.             '\nDashboard2 uses a different method of storing your account and '
  64.             'configuration details. Before copying any files, the installer '
  65.             'will read your current details and create a new configuration file.\n\n'
  66.             'You will be able to edit these settings by selecting the "Prefs" menu item in Dashboard.'
  67.         )
  68.     FinalMsg
  69.         (cat
  70.             '\nYour Wirenet software has been updated to Dashboard2.\n\n'
  71.             'There are several significant differences in the way it operates, '
  72.             'you will only benefit from these improvements if you take a few '
  73.             'minutes to read the documentation.'
  74.         )
  75.     OldLibMsg
  76.         (cat
  77.             '\nAn old version of a library was found. This has been updated but '
  78.             'you MUST reset your Amiga before proceeding with the installation '
  79.             'of Dashboard2'
  80.         )
  81.     OldLibHelp
  82.         (cat
  83.             '\nSelect "Reset Now" to reboot your machine, or "Exit" to leave it '
  84.             'until later. You MUST not run the installer until after you have '
  85.             'reset your Amiga.'
  86.         )
  87. )
  88. ;;;
  89. ;;; Check archive was unarced correctly
  90. (procedure CheckUnarc
  91.     (if (= 0 (exists 'AmiTCP/Dashboard'))
  92.         (GetOut
  93.             (cat
  94.                 '\n' ArcName 'has not been unarchived correctly!\n\n'
  95.                 'Type\n\n"lha x ' ArcName ' RAM:"\n\nin a shell and then '
  96.                 'double click on the installer icon in RAM:'
  97.             )
  98.         )
  99.     )
  100. )
  101. ;;;
  102. ;;; Check arexx is running
  103. (procedure CheckArexx
  104.     (if (run 'rx "address command"')
  105.         (if (run 'sys:rexxc/rx "address command"')
  106.             (GetOut NoArexxMsg)
  107.         )
  108.     )
  109. )
  110. ;;;
  111. ;;; Make environment variable
  112. (procedure SetEnv EnvName EnvVal                                ; Creates environment variables in ENV: and ENVARC:
  113.     (textfile
  114.         (dest (tackon 'ENVARC:' EnvName))
  115.         (append EnvVal)
  116.     )
  117.     (textfile
  118.         (dest (tackon 'ENV:' EnvName))
  119.         (append EnvVal)
  120.     )
  121. )
  122. ;;;
  123. ;;; Backup file
  124. (procedure Backup BakSrc BakDest
  125.     (if (exists BakSrc)
  126.         (copyfiles
  127.             (prompt (cat 'Backing up existing files to ' BakDest))
  128.             (help '')
  129.             (source BakSrc)
  130.             (dest BakDest)
  131.             (nogauge)
  132.         )
  133.     )
  134. )
  135. ;;;
  136. (CheckUnarc)                ; ensure archive was unpacked with paths preserved
  137. (CheckArexx)
  138. (welcome)
  139. ;=========================== Install Update ===========================
  140. ;;; Introduction
  141. (message IntroMsg)
  142. ;;;
  143. ;;; Get install path
  144. (set InstallPath (expandpath 'AmiTCP:'))
  145. (makeassign 'Wirenet' InstallPath)
  146. (set @default-dest InstallPath)
  147. ;;;
  148. ;;; Check version of current installation
  149. (set vernum (getversion 'Wirenet:Dashboard'))
  150. (set ver (/ vernum 65536))
  151. (set rev (- vernum (* ver 65536)))
  152. (set Update2 0)
  153. (if (= ver 2)
  154.     (
  155.         (if (askbool
  156.                 (prompt Already2Msg)
  157.                 (help Already2Help)
  158.                 (choices 'Update' 'Uninstall')
  159.             )
  160.             ; Update Dashboard 2
  161.             (set Update2 1)
  162.             ; Uninstall and restore Dashboard 1.5
  163.             (
  164.                 (run ';copy >NIL: AmiTCP:old/Dash#? AmiTCP: clone quiet')
  165.                 (run ';copy >NIL: AmiTCP:old/bin AmiTCP:bin clone quiet')
  166.                 (run ';copy >NIL: AmiTCP:old/envarc ENVARC: all clone quiet')
  167.                 (exit '\nDashboard 1.5 reinstalled' (quiet))
  168.             )
  169.         )
  170.     )
  171. )
  172. (if (and (<> '1.5' (cat ver '.' rev)) (= Update2 0))
  173.     (GetOut OldDBMsg)
  174. )
  175. ;;;
  176. ;;; Check version of rexxdossupport.library
  177. (if (= 1 (exists 'libs:rexxdossupport.library'))
  178.     (if (= 5 (run 'version rexxdossupport.library 3 5'))
  179.         (set OldLib 1)
  180.         (set OldLib 0)
  181.     )
  182. )
  183.  
  184. ;;;
  185. ;;; Install libraries
  186. (working 'Installing libraries')
  187. (set LibsPath (tackon (pathonly @icon) 'Libs'))
  188. (foreach LibsPath '#?'
  189.     (copylib
  190.         (prompt 'Updating libraries')
  191.         (help '')
  192.         (source (tackon LibsPath @each-name))
  193.         (dest 'LIBS:')
  194.         (nogauge)
  195.     )
  196. )
  197. ;;;
  198. ;;; Reboot if old library found
  199. (if (= 1 OldLib)
  200.     (if (askbool
  201.             (prompt OldLibMsg)
  202.             (help OldLibHelp)
  203.             (choices 'Reset Now' 'Exit')
  204.         )
  205.         (
  206.             (working '\nPlease wait while I reset.')
  207.             (run 'wait 10')
  208.             (run 'reset')
  209.         )
  210.         (exit '\nYou MUST reboot your Amiga before running the installer again' (quiet))
  211.     )
  212. )
  213. ;;;
  214. ;;; Convert configuration
  215. (if (= 0 Update2)
  216.     (
  217.         (message ConvertConfigMsg)
  218.         (working 'Converting your configuration information to new format')
  219.         (run 'rx AmiTCP/bin/AddLibs')
  220.         (run 'rx AmiTCP/bin/WirenetPrefs CONVERT')
  221.     )
  222. )
  223. ;;;
  224. ;;; Backup old files
  225. (if (= 0 Update2)
  226.     (
  227.         (message 'Backing up current files to Internet/Old')
  228.         (working 'Backing up current files to Internet/Old')
  229.         (Backup 'Wirenet:Dashboard' 'Wirenet:Old')
  230.         (Backup 'Wirenet:Dashboard.gui' 'Wirenet:Old')
  231.         (Backup 'Wirenet:Dashboard.info' 'Wirenet:Old')
  232.         (foreach 'AmiTCP/bin' '#?'
  233.             (Backup (tackon 'Wirenet:bin' @each-name) 'Wirenet:Old/bin')
  234.         )
  235.         (Backup 'ENVARC:DOMAINNAME' 'Wirenet:Old/envarc')
  236.         (Backup 'ENVARC:FTPDIR' 'Wirenet:Old/envarc')
  237.         (Backup 'ENVARC:FTPREADME' 'Wirenet:Old/envarc')
  238.         (Backup 'ENVARC:FTPSERVER' 'Wirenet:Old/envarc')
  239.         (Backup 'ENVARC:HOST' 'Wirenet:Old/envarc')
  240.         (Backup 'ENVARC:HOSTNAME' 'Wirenet:Old/envarc')
  241.         (Backup 'ENVARC:IPADDRESS' 'Wirenet:Old/envarc')
  242.         (Backup 'ENVARC:MAILBOX' 'Wirenet:Old/envarc')
  243.         (Backup 'ENVARC:MAILSERVER' 'Wirenet:Old/envarc')
  244.         (Backup 'ENVARC:MAILSERVERIP' 'Wirenet:Old/envarc')
  245.         (Backup 'ENVARC:NEWSSERVER' 'Wirenet:Old/envarc')
  246.         (Backup 'ENVARC:NEWSSERVERIP' 'Wirenet:Old/envarc')
  247.         (Backup 'ENVARC:NNTPSERVER' 'Wirenet:Old/envarc')
  248.         (Backup 'ENVARC:NODENAME' 'Wirenet:Old/envarc')
  249.         (Backup 'ENVARC:SMTPSERVER' 'Wirenet:Old/envarc')
  250.         (Backup 'ENVARC:USER' 'Wirenet:Old/envarc')
  251.         (Backup 'ENVARC:USERNAME' 'Wirenet:Old/envarc')
  252.         (Backup 'ENVARC:Wirenet.prefs' 'Wirenet:Old/envarc')
  253.         (foreach 'ENVARC:Wirenet' '#?'
  254.             (Backup (tackon 'ENVARC:Wirenet' @each-name) 'Wirenet:Old/envarc/Wirenet')
  255.         )
  256.     )
  257. )
  258. ;;;
  259. ;;; Add new assigns to user-startup
  260. (startup 'Wirenet'
  261.     (prompt '\nThere are some more assigns to be added to user-startup')
  262.     (help '\nThis will add the necessary new assigns your user-startup\n\n' @startup-help)
  263.     (command 'Assign Wirenet: ' InstallPath '\n')
  264.     (command 'Assign GUIs:      C: ADD\n')
  265. )
  266. (run 'Assign GUIs: C: ADD')
  267. ;;;
  268. ;;; Fix trailing LF on Thor environment variables
  269. (run 'setenv THOR/THORPath  `getenv THOR/THORPath`')
  270. (run 'setenv THOR/BBSDataPath `getenv THOR/BBSDataPath`')
  271. (run 'Copy >NIL: ENV:THOR/#?path ENVARC:THOR')
  272. ;;;
  273. ;;; Copy C: files
  274. (working 'Copying some files to C:')
  275. (set CPath (tackon (pathonly @icon) 'C'))
  276. (copyfiles
  277.     (prompt 'Copying new C commands')
  278.     (help '')
  279.     (source CPath)
  280.     (dest 'C:')
  281.     (all)
  282.     (nogauge)
  283. )
  284. ;;;
  285. ;;; Copy AmiTCP: files
  286. (working 'Updating Internet files')
  287. (set TCPPath (tackon (pathonly @icon) 'AmiTCP'))
  288. (working 'Copying new files')
  289. (copyfiles
  290.     (prompt '')
  291.     (help '')
  292.     (source TCPPath)
  293.     (dest 'Wirenet:')
  294.     (all)
  295.     (nogauge)
  296. )
  297.  
  298. ; Set script bits in case they were cleared when unarcing
  299. (protect 'Wirenet:bin/WirenetPrefs' '+s')
  300. (protect 'Wirenet:bin/StopProc' '+s')
  301. (protect 'Wirenet:bin/StopNet' '+s')
  302. (protect 'Wirenet:bin/GetStatus' '+s')
  303. (protect 'Wirenet:bin/Fetch' '+s')
  304. (protect 'Wirenet:bin/Disconnect' '+s')
  305. (protect 'Wirenet:bin/Connect' '+s')
  306. (protect 'Wirenet:bin/AddLibs' '+s')
  307. (protect 'Wirenet:bin/CheckOnline' '+s')
  308. (protect 'Wirenet:bin/SendEvents' '+s')
  309. (protect 'Wirenet:bin/ShowLog' '+s')
  310. (protect 'Wirenet:bin/StartNet' '+s')
  311. (protect 'Wirenet:bin/ParseThor' '+s')
  312. (protect 'Wirenet:UserScripts/Stopnet' '+s')
  313. (protect 'Wirenet:UserScripts/Startnet' '+s')
  314. (protect 'Wirenet:UserScripts/PreSend' '+s')
  315. (protect 'Wirenet:UserScripts/PreDisconnect' '+s')
  316. (protect 'Wirenet:UserScripts/PreConnect' '+s')
  317. (protect 'Wirenet:UserScripts/PostFetch' '+s')
  318. (protect 'Wirenet:UserScripts/PostDisconnect' '+s')
  319. (protect 'Wirenet:UserScripts/PostConnect' '+s')
  320. (protect 'Wirenet:UserScripts/Function.B' '+s')
  321. (protect 'Wirenet:UserScripts/Function.A' '+s')
  322. ;;;
  323. ;;; Delete old environment variables
  324. (working 'Removing redundant files from ENVARC:')
  325. (delete 'ENVARC:Wirenet/#?')
  326. (delete 'ENVARC:Wirenet')
  327. (delete 'ENVARC:DOMAINNAME')
  328. (delete 'ENVARC:FTPDIR')
  329. (delete 'ENVARC:FTPREADME')
  330. (delete 'ENVARC:FTPSERVER')
  331. (delete 'ENVARC:HOST')
  332. (delete 'ENVARC:HOSTNAME')
  333. (delete 'ENVARC:IPADDRESS')
  334. (delete 'ENVARC:MAILBOX')
  335. (delete 'ENVARC:MAILSERVER')
  336. (delete 'ENVARC:MAILSERVERIP')
  337. (delete 'ENVARC:NEWSSERVER')
  338. (delete 'ENVARC:NEWSSERVERIP')
  339. (delete 'ENVARC:NNTPSERVER')
  340. (delete 'ENVARC:NODENAME')
  341. (delete 'ENVARC:SMTPSERVER')
  342. (delete 'ENVARC:USER')
  343. (delete 'ENVARC:USERNAME')
  344. ;;;
  345. ;;; Show new docs and exit
  346. (message FinalMsg)
  347. (run 'Multiview AmiTCP/doc/Dashboard.guide')
  348. (exit)
  349. ;;;
  350.  
  351.